#ifndef HEARTBEATMONITOR_H
#define HEARTBEATMONITOR_H

#include <QObject>
#include <QTimer>
#include "IPlugin.h"

class HeartbeatMonitor : public QObject
{
   Q_OBJECT

public:
   explicit HeartbeatMonitor(QObject *parent = 0);

signals:
   void signalHearbeatRequest();
   void signalKillApplication();

public slots:
   void slotRegisterPlugin(Plugin *plugin);
   void slotHeartbeatRequest();
   void slotHeartbeatResponse();
   void slotRequestTimeout();

protected:
   QList<Plugin*> theMonitoredPlugins;
   QList<Plugin*> theRespondedPlugins;
   QTimer theHeartbeatTimer;
   QTimer theResponseTimer;

   quint32 theHeartbeatIntervalSec;
   quint32 theResponseTimeoutSec;
};

#endif // HEARTBEATMONITOR_H
